namespace PickGold.Charting
{
    using System;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Globalization;

    internal class HotRegion : IDisposable
    {
        private RectangleF _boundingRectangle = RectangleF.Empty;
        private GraphicsPath _path;
        private int _pointIndex = -1;
        private bool _relativeCoordinates = true;
        private object _selectedObject;
        private object _selectedSubObject;
        private string _seriesName = "";
        private ChartElementType _type;

        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (disposing && (this._path != null))
            {
                this._path.Dispose();
                this._path = null;
            }
        }

        public override string ToString()
        {
            string seriesName = (this.SelectedObject != null) ? this.SelectedObject.ToString() : "null";
            if ((this.SelectedObject == null) && !string.IsNullOrEmpty(this.SeriesName))
            {
                seriesName = this.SeriesName;
            }
            return string.Format(CultureInfo.CurrentCulture, "{0} of {1}", new object[] { this.Type, seriesName });
        }

        internal RectangleF BoundingRectangle
        {
            get
            {
                return this._boundingRectangle;
            }
            set
            {
                this._boundingRectangle = value;
            }
        }

        internal GraphicsPath Path
        {
            get
            {
                return this._path;
            }
            set
            {
                this._path = value;
            }
        }

        internal int PointIndex
        {
            get
            {
                return this._pointIndex;
            }
            set
            {
                this._pointIndex = value;
            }
        }

        internal bool RelativeCoordinates
        {
            get
            {
                return this._relativeCoordinates;
            }
            set
            {
                this._relativeCoordinates = value;
            }
        }

        internal object SelectedObject
        {
            get
            {
                return this._selectedObject;
            }
            set
            {
                this._selectedObject = value;
            }
        }

        internal object SelectedSubObject
        {
            get
            {
                return this._selectedSubObject;
            }
            set
            {
                this._selectedSubObject = value;
            }
        }

        internal string SeriesName
        {
            get
            {
                return this._seriesName;
            }
            set
            {
                this._seriesName = value;
            }
        }

        internal ChartElementType Type
        {
            get
            {
                return this._type;
            }
            set
            {
                this._type = value;
            }
        }
    }
}

